home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
E.M.Computergraphic Phase 4
/
Phase 4 - Desktop Video Dreams (E. M. Computergraphic)(1996).iso
/
utilities
/
mainactor
/
rexx
/
scale_adpro.ma
< prev
next >
Wrap
Text File
|
1996-01-17
|
3KB
|
144 lines
/*
*
* Scale V 1.1, 1993 Markus Moenig
*
* Scales the source project to a requested size, needs AdPro !!
* The new project will also be in the format of the selected save module.
*
* The loader/saver of the source project can be either picture
* or animation modules.
*
* A new project will be opened for the resulting pictures/animation.
*/
OPTIONS RESULTS
ADDRESS MAINACTOR
ScreenToFront
PrintAndStoreTXT "Scale V1.1, scaling project ..."
IF ~SHOW('P','ADPro') THEN DO /* if not allready running, start adpro */
ADDRESS MAINACTOR PrintTXT "Invoking AdPro ..."
ADDRESS COMMAND 'run >NIL: <NIL: adpro:adpro BEHIND MAXMEM=1000000'
ADDRESS COMMAND Wait 5
END
ADDRESS MAINACTOR
GetSPName
IF rc = 0 THEN DO /* check if project loaded */
PARSE VAR RESULT firstname secondname . /* store name of the animation */
/* or the names of the picture list */
ScreenToFront
DeSelectAll
GetSPSaver
PARSE VAR RESULT savertype savername . /* store type, name of saver module */
/* Store general infos of the project */
GetSPInfo
PARSE VAR RESULT width height colors pics caching loop cpf .
RequestInteger width "Enter new Width"
IF RC = 10 THEN DO
PrintTXT "Aborting ..."
EXIT
END
newxsize=RESULT
RequestInteger height "Enter new Height"
IF RC = 10 THEN DO
PrintTXT "Aborting ..."
EXIT
END
newysize=RESULT
Scale=newxsize || " " || newysize
IF savertype = "PIC" THEN
picformat=savername
ELSE DO
picformat=IFF
SetSPSaver PIC picformat
END
ADDRESS "ADPro"
LFormat "Universal"
PSTATUS UNLOCKED
ORIENTATION PORTRAIT
SFormat picformat
ADDRESS MAINACTOR
RequestSaveFile "Select Name of Project" /* Ask for Project Name */
IF RC = 10 THEN DO
PrintTXT "Aborting ..."
EXIT
END
newname = RESULT /* new name = RESULT */
SelectAll
saveargs=newname
Save saveargs /* Save Pictures */
DO i=1 to pics /* Scale all pics */
actualpic=newname || "." || Right("00000" || i, 5)
PrintTxt "ADPro scales Picture" i
ADDRESS "ADPro"
Load actualpic
RENDER_TYPE colors
ABS_SCALE Scale
PSORT 0
Execute
Save actualpic IMAGE
ADDRESS MAINACTOR
END
IF caching = "CACHING=YES" THEN /* Was the old project cached ? */
OpenNewProject "CACHING" /* If yes new project is also cached */
ELSE
OpenNewProject /* If not new project is not cached */
SetSPLoader PIC picformat /* Set the new projects loader module */
firstpic=newname || "." || Right("00000" || 1, 5)
lastpic=newname || "." || Right("00000" || pics, 5)
LoadProject firstpic lastpic /* Load picture list */
SetSPSaver savertype savername
IF savertype = "ANIM" THEN DO /* If we wanted a new animation, */
/* we have to build it */
SelectAll
saveargs=newname || " " || cpf || " " || loop
Save saveargs
UnloadProject
DO i=1 TO pics /* delete temporary pics */
actualpic=newname || "." || Right("00000" || i, 5)
PrintTxt "Delete " || actualpic
ADDRESS COMMAND "delete " || actualpic || "#?"
END
SetSPLoader savertype savername
LoadProject newname
END
PrintAndStoreTXT "READY !!!!"
END